package com.ztools.common.model.pc.store;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ztools.common.model.pc.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author seeTools
 * @since 2023-05-28
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("store_stock_detail")
public class StoreStockDetail extends BaseModel {

    private static final long serialVersionUID = 1L;


    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 商品ID
     */
    @TableField(value = "commodity_id")
    private Long commodityId;

    /**
     * 商品名称
     */
    @TableField(exist = false)
    private String commodityName;

    /**
     * 入库数量
     */
    @TableField(value = "quantity")
    private Integer quantity;

    /**
     * 入库后数量
     */
    @TableField(value = "after_quantity")
    private Integer afterQuantity;

    /**
     * 入库前数量
     */
    @TableField(value = "before_quantity")
    private Integer beforeQuantity;

    /**
     * 成本价
     */
    @JSONField(format = "#0.00")
    @TableField(value = "cost_price")
    private BigDecimal costPrice;

    /**
     * 金额小计
     */
    @JSONField(format = "#0.00")
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 入库时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "in_date")
    private Date inDate;

    /**
     * 业务场景
     */
    private Integer scene;

    /**
     * 场景名称
     */
    @TableField(exist = false)
    private String sceneName;
}
